package com.itheima.myextends.继承下成员变量访问特点_04.测试包;


class Ye{
    int age = 65;
}

class Fu extends Ye {
    public void method01(){
        int age = 45;       // 局部变量
    }
}

public class Zi extends Fu {


    public void method(){
        //打印值为65的age
        System.out.println(new Ye().age);
        System.out.println(super.age);

        //注意: this.在找本类成员找不到时,会渗透到父类成员位置寻找
        // this找不到本类成员时,效果等同于super!
        System.out.println(this.age);
        System.out.println(age);
    }
}

